package com.jrfid.smartcabinet.demo.base

import android.app.Activity
import android.app.Application
import android.view.View
import androidx.lifecycle.*
import androidx.navigation.NavController

/**
 * author: shihao
 * date: 2020/12/14 9:29
 * description:
 */
open class BaseViewModel(application: Application, protected val navController: NavController) : AndroidViewModel(application), DefaultLifecycleObserver {
    val TAG = this.javaClass.simpleName

    fun getString(resId: Int): String {
        return getApplication<Application>().getString(resId)
    }

    fun getStringFormat(resId: Int, vararg formatArgs: Any): String {
        return getApplication<Application>().getString(resId, *formatArgs)
    }
}